/**
 * Created by vincent on 2017/1/12.
 */
moduleCommon.service('TokenService', function ($rootScope, $interval, $q, ConstantService, $$CambioConfig) {

    //var refreshFn;

    this.setToken = function (data) {
        if ($$CambioConfig.SYSTEM_SPACE == 'CAMBIO') {
            ConstantService.setItem("token", data.accessToken);
            ConstantService.setItem("userId", data.userId);
        }
        if ($$CambioConfig.SYSTEM_SPACE == 'SZ') {
            ConstantService.setItem("authorization", data.authorization);
            ConstantService.setItem("userId", data.id);
        }
    };
});